import  React from 'react'


export default  class  Books   extends React.Component {


        componentDidMount() {
            console.log(this.props)
        }

    goToHome=()=>{


// 编程式路由    
   this.props.history.push('/home')
// state  给reudx 使用
this.props.history.push({
    pathname: '/home',
    search: '?the=query',
    params:{myname:'zs'},
    state: { some: 'state' }
  });


    }
    render() {


        return(
            <div>
                Books


                <button onClick={this.goToHome}>点击按钮跳转到home组件</button>
            </div>
        )
    }
}